<template>
  <el class="comment-detail">
    <el-card class="product-card">
      <div class="product-info">
        <div class="announcement-detail">
          <div style="text-align: center;color: #79bbff;font-size:15px;"><h1>{{ notices.notice_type }}</h1></div>
          <img :src="`http://localhost:8080/image/upload/${notices.notice_image}`"
               alt="notice_image"
               style="display: block; margin: 0 auto; width: 200px; height: 200px;">
          <div style="text-align: center;font-size:13px; "><h2>{{ notices.notice_theme }}</h2></div>
          <br/>
          <div v-html="notices.notice_content" style="font-size:15px"></div>
        </div>
      </div>
    </el-card>
  </el>
</template>

<script>
export default {
  data() {
    return {
      notice_id:null,
      notices: {}
    }
  },
  methods: {
    //进行传值数据处理
    Parameter(){
      if(this.$route.params.noticeId!=null){
        this.notice_id=this.$route.params.noticeId;
      }
      return this.notice_id;
    },
    showNotice() {
      this.$http.get("http://localhost:8080/notice/showDetails", {
        params: {
          notice_id:this.Parameter()
        }
      }).then((res) => {
        this.notices = res.data;
        console.log(this.notices);
      }).catch(function (err) {
        console.log(err);
      })
    }
  },
  mounted() {
    this.showNotice()
  }
}
</script>

<style scoped>
.announcement-detail {
  /* 在这里添加你的样式 */
}
.comment-detail {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 150vh;
}

.product-card {
  width: 1000px;
  padding: 20px;
  border-radius: 10px;
  height: 150vh;
}

.product-info {
  display: flex;
  align-items: flex-start;
  max-height: 400px;
}
.product-image {
  flex: 1;
}
.product-image img {
  width: 100%;
  height: auto;
}

.product-details {
  flex: 2;
  padding: 0 20px;
}
</style>
